Repository navigation
Conversation
|
I've assigned @tnull as a reviewer! |
Anyitechs
force-pushed
the
2026-07-lsps1-service-integration
branch
3 times, most recently
from
August 26, 2026 03:12
1b93d7b to
0a20f85
Compare
Anyitechs
force-pushed
the
2026-07-lsps1-service-integration
branch
from
September 14, 2026 18:22
0a20f85 to
f159826
Compare
5 tasks
Anyitechs
force-pushed
the
2026-07-lsps1-service-integration
branch
5 times, most recently
from
October 13, 2026 23:48
29ac964 to
ffa9b3a
Compare
Anyitechs
force-pushed
the
2026-07-lsps1-service-integration
branch
from
October 21, 2026 15:34
ffa9b3a to
94fe523
Compare
Anyitechs
marked this pull request as ready for review
October 31, 2026 08:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds LSPS1 server side support to LDK Node, enabling a node to act as an LSPS1 service.
Details
The service exposes an
LSPS1Serviceobject that holds the LSPS1supported_optionsand a localservice_configobject allowing the LSP to configure their fee details, signal BOLT11, BOLT12 and/or onchain payments support etc.Client requests arriving via
LSPS1ServiceEvent::RequestForPaymentDetailsare kept in the store after validations per the spec requirements, and the LSP supported payment details sent back to the client viaLSPS1ServiceHandler::send_payment_details.Payments
BOLT11/BOLT12: When an
LdkEvent::PaymentClaimableevent arrives, we intercept early to check if the payment was an LSPS1 order payment, and goes ahead to claim it viaChannelManager::claim_fundsif we find a matchingpayment_hashoroffer_idin the store. Afterward, we open the channel and remove the order from the store.Onchain Payments: After a wallet sync completes, we check to confirm if an LSPS1 payment did land in our onchain wallet, then opens the channel if we can find the payment via
Wallet::list_confirmed_utxos().Each payment option has an expiration window. Invoices has an expiration time, so we expect the client node to refuse paying an expired invoice. But Onchain payments are different, so if a client sends to the LSP's address after the expiration window, we trigger a refund back to the client's
refund_onchain_addressthe total amount received minus the network fees.There's a 24 hour window to remove orders from the store to avoid bloating. This is majorly for unpaid orders as paid orders are processed as soon as the payment arrives and removed from the store. But because there's no way to stop an LSP address from receiving payments when the order has been created and payment details sent out to the client. Such payments arriving when the order has been removed are forfeited.
Tests
Integration tests for the three payment options happy path are added.
Closes #917